public class Main {
    public static void main(String[] args) {
MyThead2 t1=new MyThead2("MyThread");
t1.start();
try{
    t1.join();
}catch (InterruptedException e){

}
        for (int i = 1; i < 4; i++) {
            System.out.println("这是main");
        }
    }
}
class MyThead2 extends Thread{
    MyThead2(String s){
        super(s);
    }
  public  void run(){
        for(int i=1;i<=4;i++){
            System.out.println("那是"+getName());
            try{
                sleep(200);
            }catch (InterruptedException e){

            }
        }
    }
}